import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TEatParadeConfig } from "../../../Message/Db/Tables/TEatParadeConfig";
type int = number;
//class EatParadeConfig
    
    export  class EatParadeConfig
    {
        constructor()
        {
            
            this._eatParadeNpcIdMap = new Map<any, any> /* flash.utils.Dictionary */();
            if (EatParadeConfig._instance != null) 
            {
                throw new Error("EatParadeConfig 单例");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_eat_parade_config.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TEatParadeConfig();
                loc1.bossrefresh = loc2.bossrefresh;
                loc1.id = loc2.id;
                loc1.npcid = loc2.npcid;
                loc1.order = loc2.order;
                this._eatParadeNpcIdMap[loc1.order] = loc1.npcid;
            }
            return;
        }

        public getActiveNpcIds(): Array<any>
        {
            return [this._eatParadeNpcIdMap[0]];
        }

        public getParadeNpcIds(): Array<any>
        {
            return [this._eatParadeNpcIdMap[1], this._eatParadeNpcIdMap[2]];
        }

        public isActiveNpc(arg1: int): Boolean
        {
            return arg1 != this._eatParadeNpcIdMap[0] ? false : true;
        }

        public isParadeNpc(arg1: int): Boolean
        {
            var loc1=false;
            if (arg1 == this._eatParadeNpcIdMap[1] || arg1 == this._eatParadeNpcIdMap[2]) 
            {
                loc1 = true;
            }
            return loc1;
        }

        public static get instance(): EatParadeConfig
        {
            if (EatParadeConfig._instance == null) 
            {
                EatParadeConfig._instance = new EatParadeConfig();
            }
            return EatParadeConfig._instance;
        }

        /* internal */ /* var */_eatParadeNpcIdMap: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: EatParadeConfig;
    }
